package com.kly.user.enums;

/**
 * 权限类型：1-位置授权
 * @author linqu
 */
public enum PermissionTypeEnum {

    location(1, "location", "位置授权"),
    notification(2, "notification", "通知权限"),
    ;

    private final Integer type;

    private final String Value;

    private final String description;


    PermissionTypeEnum(Integer type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public Integer getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static PermissionTypeEnum fromType(Integer type) {
        if (type == null) {
            return null;
        }
        for (PermissionTypeEnum opTypeEnum : values()) {
            if (opTypeEnum.getType().equals(type)) {
                return opTypeEnum;
            }
        }
        return null;
    }
}
